package com.cjm.one.goods.apps;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.common.utils.AuthCustomerContextHolder;
import com.cjm.one.goods.service.GoodsInfoService;
import com.cjm.one.model.custom.entity.CustomerInfo;
import com.cjm.one.model.goods.entity.GoodsInfo;
import com.cjm.one.model.goods.enums.SortStrategyEnum;
import com.cjm.one.model.goods.vo.GoodsInfoVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/app/goods/info")
@Tag(name = "商品", description = "商品")
public class AppGoodsInfoConterller {

    @Resource
    private GoodsInfoService goodsService;

    @GetMapping
    @Operation(summary = "获取商品详情")
    public Result<GoodsInfoVo> getByIdInfo(@RequestParam("id") Long id) {

        GoodsInfoVo goodsInfo = goodsService.getGoodsInfoById(id);
        return Result.ok(goodsInfo);
    }


}
